package com.lzw.d25bingso.titleview;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.TextView;

import com.lzw.d25bingso.R;

/**
 * Created by lzw on 2017/5/17.
 */

public class TitleView extends FrameLayout {


    private TextView title_tv;
    private ImageButton title_ib;

    public TitleView(@NonNull Context context) {
        super(context);
    }

    public TitleView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.title,this);
        title_tv = (TextView) findViewById(R.id.title_tv_id);
        title_ib = (ImageButton) findViewById(R.id.title_ib_id);
    }
    public void setTextView(String text){
        title_tv.setText(text);
    }
    public void setListener(OnClickListener listener){
        title_ib.setOnClickListener(listener);
    }
}
